<?php
error_reporting(0);
session_start();
$name=$_SESSION["user"]; if($name==NULL)
{
    header("Location:login.php");
    exit;
}
else{
    header("Location:main.php");
}
?>